package net.sxnic.workflow.chart;

public class ChartNode {

	public static final int SELF_WIDTH = 100;

	public static final int SELF_HIGHT = 25;

	public static final String STATUS_ACTIVED = "actived";

	public static final String STATUS_PASSED = "passed";

	public static final String STATUS_WAITTING = "waitting";

	private String name;

	// start开始节点 task普通节点 end结束节点
	private String cate;

	// actived正在执行 passed已完成  waitting等待/未接到任务
	private String status;

	// main read
	private String type;

	private String cssClass;

	private String cssStyle;

	private int x;

	private int y;
	
	private ChartLine preLine;

	public ChartNode() {
		super();
	}

	public String crtHtml() {

		StringBuffer sb = new StringBuffer();

		// <a href="javascript:void(0);" title="办公室审批"
		// class="step pop-tip step-start" id="step-1" name="办公室审批" type="main"
		// state="passed" style="left: 5px; top: 5px;">办公室审批</a>

		sb.append("<a href='javascript:void(0);' title='" + name
				+ "' class='step ");

		if ("start".equals(cate)) {
			sb.append("step-start'");
		} else {
			sb.append(" step-" + type + "-" + status+"'");
		}

//		sb.append(" name='" + name + "' type='" + type + "' state='"
//				+ status + "' style='left:" + x + "px; top:" + y + "px>"
//				+ name + "</a></n>");
		
		sb.append("  type='" + type + "' style='left:" + x + "px; top:" + y + "px;'>"
		+ name + "</a>");

		return sb.toString();
	}

	public String getCate() {
		return cate;
	}

	public void setCate(String cate) {
		this.cate = cate;
	}

	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

	public String getCssClass() {
		return cssClass;
	}

	public void setCssClass(String cssClass) {
		this.cssClass = cssClass;
	}

	public String getCssStyle() {
		return cssStyle;
	}

	public void setCssStyle(String cssStyle) {
		this.cssStyle = cssStyle;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public ChartLine getPreLine() {
		return preLine;
	}

	public void setPreLine(ChartLine preLine) {
		this.preLine = preLine;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

}
